-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Control block forging through NodeKernel #140
Conversation
d52de2e
to
982a1d9
Compare
a4e3479
to
a888016
Compare
...oros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/NodeKernel.hs
Show resolved
Hide resolved
...oros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/NodeKernel.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/API.hs
Outdated
Show resolved
Hide resolved
...ros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/Background.hs
Outdated
Show resolved
Hide resolved
...ros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/Background.hs
Show resolved
Hide resolved
...ros-consensus-diffusion/changelog.d/20230612_124926_armandoifsantos_dynamic_block_forging.md
Outdated
Show resolved
Hide resolved
...boros-consensus-cardano/changelog.d/20230612_125709_armandoifsantos_dynamic_block_forging.md
Outdated
Show resolved
Hide resolved
...boros-consensus-cardano/changelog.d/20230612_125709_armandoifsantos_dynamic_block_forging.md
Outdated
Show resolved
Hide resolved
...boros-consensus-cardano/changelog.d/20230612_125709_armandoifsantos_dynamic_block_forging.md
Outdated
Show resolved
Hide resolved
@@ -82,9 +82,11 @@ protocolInfoDualByron :: forall m. Monad m | |||
=> ByronSpecGenesis | |||
-> PBftParams | |||
-> [CoreNodeId] -- ^ Are we a core node? | |||
-> ProtocolInfo m DualByronBlock | |||
-> ( ProtocolInfo DualByronBlock | |||
, m [BlockForging m DualByronBlock] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we return two things I wonder if we should rename this function.
Also, we should add a comment explaining what the second component of the tuple is, and maybe how it relates to the input parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah maybe but that would be a very disruptive change, wouldn't it?
ouroboros-consensus-cardano/src/byron-testlib/Ouroboros/Consensus/ByronDual/Node.hs
Show resolved
Hide resolved
...ros-consensus-diffusion/changelog.d/20230612_124926_armandoifsantos_dynamic_block_forging.md
Show resolved
Hide resolved
...ros-consensus-diffusion/changelog.d/20230612_124926_armandoifsantos_dynamic_block_forging.md
Outdated
Show resolved
Hide resolved
...ros-consensus-diffusion/changelog.d/20230612_124926_armandoifsantos_dynamic_block_forging.md
Outdated
Show resolved
Hide resolved
...ros-consensus-diffusion/changelog.d/20230612_124926_armandoifsantos_dynamic_block_forging.md
Outdated
Show resolved
Hide resolved
ouroboros-consensus/changelog.d/20230612_112138_armandoifsantos_dynamic_block_forging.md
Outdated
Show resolved
Hide resolved
ouroboros-consensus/changelog.d/20230612_112138_armandoifsantos_dynamic_block_forging.md
Show resolved
Hide resolved
ouroboros-consensus/changelog.d/20230612_112138_armandoifsantos_dynamic_block_forging.md
Outdated
Show resolved
Hide resolved
a888016
to
a01bf12
Compare
...oros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/NodeKernel.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/API.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/API.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/API.hs
Show resolved
Hide resolved
...ros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ChainDB/Impl/Background.hs
Show resolved
Hide resolved
A higher-level note from our mob call reviewing this PR:
|
a01bf12
to
85a2441
Compare
e0d484a
to
d639fbd
Compare
Block forging is removed from ProtocolInfo, and can controlled by using `NodeKernel` field: `setProtocolForging :: [BlockForging m blk] -> m ()`. Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Marcin Szamotulski <coot@coot.me>
When make sure that when a block is added to the ChainDB, transactions will be removed from the mempool. The 'addBlockAsync' is a lightweight non-blocking operation but the finalizer is blocking (`blockProcessed` will block until the block was added to the ChainDB). Hence we need to use `uninterruptibleMask_` to make it safe in presence of asynchronous exceptions. Co-authored-by: Marcin Szamotulski <coot@coot.me>
When the block forger thread adds a new block, the adding thread might be killed by an async exception. If that happens, the block forger will get 'Nothing' when `blockProcessed` returns, and it can exit. Co-authored-by: Marcin Szamotulski <coot@coot.me>
d639fbd
to
e22b424
Compare
This PR supersedes IntersectMBO/ouroboros-network#3800 and regards issue IntersectMBO/ouroboros-network#3159.
I mostly just "rebased" the old
ouroboros-network
branch on top of this new repo. Please look at the discussions in the old PR for more details.This PR is co-authored-by: Marcin Szamotulski coot@coot.me @coot